<?php

class dbaArtCats {

 function dbaArtCats (&$dba){
    $this->dba = &$dba;
 }

 function checkArticleCat ($cat){
   $check = $this->dba->query("select cat_id from ".$this->dba->tableforwarder."_shopCatArt where cat_id=$cat;");
   $num_rows = $this->dba->num_rows();
   if ($num_rows > 0){
     return true;
   } else {
     return false;
   }
 }

 function addArtCat ($cat_id,$art_id){
  return $this->dba->query("insert into ".$this->dba->tableforwarder."_shopCatArt (cat_id,art_id) values ($cat_id,$art_id);");
 }

 function getArtCatsByArticle ($art_id){
   $this->dba->query("select * from ".$this->dba->tableforwarder."_shopCatArt where art_id = $art_id;");
   return $this->dba->fetch_rows_Array();
 }

 function getArtCatsByCategory ($cat_id){
   $this->dba->query("select * from ".$this->dba->tableforwarder."_shopCatArt where cat_id = $cat_id;");
   return $this->dba->fetch_rows_Array();
 }

 function delArtCat ($id){
  return $this->dba->query("delete from ".$this->dba->tableforwarder."_shopCatArt where catart_id = $id;");
 }

}

?>
